package com.learn.spring5.factorybean;

import org.springframework.beans.factory.FactoryBean;

import com.learn.spring5.collectiontype.Course;

//工厂Bean
public class MyBean implements FactoryBean<Course> {
	// 工厂bean会通过FactoryBean的接口的getObject()方法将对象注册在容器中
	// 定义类型和返回类型不一样
	public Course getObject() throws Exception {
		Course course = new Course();
		course.setCname("abc");
		return course;
	}

	public Class getObjectType() {
		// TODO Auto-generated method stub
		return null;
	}

}
